#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
//http://oj33.cn/contest.php?cid=1075
//https://blog.csdn.net/qq_37482202/article/details/89513877
int main()
{
	long long x, y;
	scanf("%lld%lld", &x, &y);
	long long xi, yi;
	long  double len = 0;

	long long a1;
	long long b1;
	int i = 0;
	while((scanf("%lld%lld%lld%lld",&xi,&yi,&a1,&b1)!=EOF))
	{
		i++;
	len += sqrt((yi - b1) * (yi - b1) + (xi - a1) * (xi - a1));
	}
	printf("%lld:%02lld\n",(int)len / 10000, (int)((((len / 10000) - (int)(len / 10000))*60)+0.5));
	return 0;
}
//#include<bits/stdc++.h>
//using namespace std;
//int main()
//{
//    ios::sync_with_stdio(false);
//    long long int x, y;
//    cin >> x >> y;
//    long long int x1, y1, x2, y2;
//    double sum = 0;
//    while (cin >> x1 >> y1 >> x2 >> y2) {
//        sum += sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
//    }
//    double ans = sum * 2 / 1000 / 20;
//    long long int h = (int)(ans);
//    long long int f = (int)((ans - h) * 60 + 0.5);
//    printf("%lld:%02lld\n", h, f);
//    return 0;
//}